package com.visionet.school.app.web.entity.enums;

/**
 * Created by hxpeng on 2017/3/27.
 */
public enum MemberRelType {

    FATHER("father","父亲"),
    MOTHER("mother","母亲");

    private String key;
    private String value;

    MemberRelType(String key, String value){
        this.key = key;
        this.value = value;
    }

    public static MemberRelType fromCode(String key){
        for (MemberRelType type : values()){
            if(type.key.equalsIgnoreCase(key)){
                return type;
            }
        }
        return null;
    }

    public String toKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
